3.347 \(\int \frac{\cot (c+d x) (A+B \tan (c+d x))}{\sqrt{a+b \tan (c+d x)}} \, dx\)

Optimal. Leaf size=131 \[ \frac{(A-i B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-i b}}\right )}{d \sqrt{a-i b}}+\frac{(A+i B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+i b}}\right )}{d \sqrt{a+i b}}-\frac{2 A \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{\sqrt{a} d} \]

[Out]

(-2*A*ArcTanh[Sqrt[a + b*Tan[c + d*x]]/Sqrt[a]])/(Sqrt[a]*d) + ((A - I*B)*ArcTanh[Sqrt[a + b*Tan[c + d*x]]/Sqr
t[a - I*b]])/(Sqrt[a - I*b]*d) + ((A + I*B)*ArcTanh[Sqrt[a + b*Tan[c + d*x]]/Sqrt[a + I*b]])/(Sqrt[a + I*b]*d)

________________________________________________________________________________________

Rubi [A]  time = 0.339725, antiderivative size = 131, normalized size of antiderivative = 1., number of steps used = 11, number of rules used = 6, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.194, Rules used = {3613, 3539, 3537, 63, 208, 3634} \[ \frac{(A-i B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-i b}}\right )}{d \sqrt{a-i b}}+\frac{(A+i B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+i b}}\right )}{d \sqrt{a+i b}}-\frac{2 A \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{\sqrt{a} d} \]

Antiderivative was successfully verified.

[In]

Int[(Cot[c + d*x]*(A + B*Tan[c + d*x]))/Sqrt[a + b*Tan[c + d*x]],x]

[Out]

(-2*A*ArcTanh[Sqrt[a + b*Tan[c + d*x]]/Sqrt[a]])/(Sqrt[a]*d) + ((A - I*B)*ArcTanh[Sqrt[a + b*Tan[c + d*x]]/Sqr
t[a - I*b]])/(Sqrt[a - I*b]*d) + ((A + I*B)*ArcTanh[Sqrt[a + b*Tan[c + d*x]]/Sqrt[a + I*b]])/(Sqrt[a + I*b]*d)

Rule 3613

Int[(((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_))/((a_.) + (b_.)*tan[
(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[1/(a^2 + b^2), Int[(c + d*Tan[e + f*x])^n*Simp[a*A + b*B - (A*b - a*B)
*Tan[e + f*x], x], x], x] + Dist[(b*(A*b - a*B))/(a^2 + b^2), Int[((c + d*Tan[e + f*x])^n*(1 + Tan[e + f*x]^2)
)/(a + b*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2,
 0] && NeQ[c^2 + d^2, 0]

Rule 3539

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[(c
 + I*d)/2, Int[(a + b*Tan[e + f*x])^m*(1 - I*Tan[e + f*x]), x], x] + Dist[(c - I*d)/2, Int[(a + b*Tan[e + f*x]
)^m*(1 + I*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0]
&& NeQ[c^2 + d^2, 0] &&  !IntegerQ[m]

Rule 3537

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[(c*
d)/f, Subst[Int[(a + (b*x)/d)^m/(d^2 + c*x), x], x, d*Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m}, x] &&
NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && EqQ[c^2 + d^2, 0]

Rule 63

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - (a*d)/b + (d*x^p)/b)^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 208

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-(a/b), 2]*ArcTanh[x/Rt[-(a/b), 2]])/a, x] /; FreeQ[{a,
b}, x] && NegQ[a/b]

Rule 3634

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.)*((A_) + (C_.)*
tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[A/f, Subst[Int[(a + b*x)^m*(c + d*x)^n, x], x, Tan[e + f*x]], x]
 /; FreeQ[{a, b, c, d, e, f, A, C, m, n}, x] && EqQ[A, C]

Rubi steps

\begin{align*} \int \frac{\cot (c+d x) (A+B \tan (c+d x))}{\sqrt{a+b \tan (c+d x)}} \, dx &=A \int \frac{\cot (c+d x) \left (1+\tan ^2(c+d x)\right )}{\sqrt{a+b \tan (c+d x)}} \, dx+\int \frac{B-A \tan (c+d x)}{\sqrt{a+b \tan (c+d x)}} \, dx\\ &=\frac{1}{2} (-i A+B) \int \frac{1-i \tan (c+d x)}{\sqrt{a+b \tan (c+d x)}} \, dx+\frac{1}{2} (i A+B) \int \frac{1+i \tan (c+d x)}{\sqrt{a+b \tan (c+d x)}} \, dx+\frac{A \operatorname{Subst}\left (\int \frac{1}{x \sqrt{a+b x}} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac{(2 A) \operatorname{Subst}\left (\int \frac{1}{-\frac{a}{b}+\frac{x^2}{b}} \, dx,x,\sqrt{a+b \tan (c+d x)}\right )}{b d}-\frac{(A-i B) \operatorname{Subst}\left (\int \frac{1}{(-1+x) \sqrt{a-i b x}} \, dx,x,i \tan (c+d x)\right )}{2 d}-\frac{(A+i B) \operatorname{Subst}\left (\int \frac{1}{(-1+x) \sqrt{a+i b x}} \, dx,x,-i \tan (c+d x)\right )}{2 d}\\ &=-\frac{2 A \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{\sqrt{a} d}+\frac{(i A-B) \operatorname{Subst}\left (\int \frac{1}{-1+\frac{i a}{b}-\frac{i x^2}{b}} \, dx,x,\sqrt{a+b \tan (c+d x)}\right )}{b d}-\frac{(i A+B) \operatorname{Subst}\left (\int \frac{1}{-1-\frac{i a}{b}+\frac{i x^2}{b}} \, dx,x,\sqrt{a+b \tan (c+d x)}\right )}{b d}\\ &=-\frac{2 A \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{\sqrt{a} d}+\frac{(A-i B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-i b}}\right )}{\sqrt{a-i b} d}+\frac{(A+i B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+i b}}\right )}{\sqrt{a+i b} d}\\ \end{align*}

Mathematica [A]  time = 0.707593, size = 170, normalized size = 1.3 \[ -\frac{\frac{\frac{\left (\sqrt{-b^2} B-A b\right ) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-\sqrt{-b^2}}}\right )}{\sqrt{a-\sqrt{-b^2}}}-\frac{\left (A b+\sqrt{-b^2} B\right ) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+\sqrt{-b^2}}}\right )}{\sqrt{a+\sqrt{-b^2}}}}{b}+\frac{2 A \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{\sqrt{a}}}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[(Cot[c + d*x]*(A + B*Tan[c + d*x]))/Sqrt[a + b*Tan[c + d*x]],x]

[Out]

-(((2*A*ArcTanh[Sqrt[a + b*Tan[c + d*x]]/Sqrt[a]])/Sqrt[a] + (((-(A*b) + Sqrt[-b^2]*B)*ArcTanh[Sqrt[a + b*Tan[
c + d*x]]/Sqrt[a - Sqrt[-b^2]]])/Sqrt[a - Sqrt[-b^2]] - ((A*b + Sqrt[-b^2]*B)*ArcTanh[Sqrt[a + b*Tan[c + d*x]]
/Sqrt[a + Sqrt[-b^2]]])/Sqrt[a + Sqrt[-b^2]])/b)/d)

________________________________________________________________________________________

Maple [C]  time = 1.214, size = 33052, normalized size = 252.3 \begin{align*} \text{output too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)*(A+B*tan(d*x+c))/(a+b*tan(d*x+c))^(1/2),x)

[Out]

result too large to display

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(A+B*tan(d*x+c))/(a+b*tan(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(A+B*tan(d*x+c))/(a+b*tan(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

Timed out

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (A + B \tan{\left (c + d x \right )}\right ) \cot{\left (c + d x \right )}}{\sqrt{a + b \tan{\left (c + d x \right )}}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(A+B*tan(d*x+c))/(a+b*tan(d*x+c))**(1/2),x)

[Out]

Integral((A + B*tan(c + d*x))*cot(c + d*x)/sqrt(a + b*tan(c + d*x)), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (B \tan \left (d x + c\right ) + A\right )} \cot \left (d x + c\right )}{\sqrt{b \tan \left (d x + c\right ) + a}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(A+B*tan(d*x+c))/(a+b*tan(d*x+c))^(1/2),x, algorithm="giac")

[Out]

integrate((B*tan(d*x + c) + A)*cot(d*x + c)/sqrt(b*tan(d*x + c) + a), x)